<template>
  <div class="person">
    <h2>学生姓名: {{ name }}</h2>
    <h2>学生年龄: {{ age }}</h2>
    <button @click="showMsg">点我</button>
  </div>
</template>

<script>
export default {
  name: "Person",
  data() {
    return {
      name: "周亮",
      age: 18,
      subject: "前端",
    };
  },
  methods: {
    showMsg() {
      alert(`我的名字是: ${this.name}, 我学的是: ${this.subject}`);
    },
  },
};
</script>

<style>
.person {
    background-color: bisque;
}
</style>